Repository navigation
Install scripts: update an installed Claude Code plugin - #1824
Merged
Merged
Conversation
The Claude Code plugin comes from a GitHub marketplace, which Claude Code
does not auto-update, so updating the binary (by hand or by auto-update)
left an old plugin behind. When the claude CLI is on PATH and
plannotator@plannotator has a user-scope record in
${CLAUDE_CONFIG_DIR:-~/.claude}/plugins/installed_plugins.json, all three
installers now run 'claude plugin marketplace update plannotator' and
'claude plugin update plannotator@plannotator' right after the legacy
hooks.json repair: time-bounded, stdin closed, CLAUDECODE cleared, never
failing the install (a failure prints the manual commands). The closing
banner follows what happened.
Opt out with --skip-claude-plugin (-SkipClaudePlugin),
PLANNOTATOR_SKIP_CLAUDE_PLUGIN_UPDATE=1 or skipInstall.claudePlugin;
--minimal skips it. The flag is recorded in install-flags.json as
skip-claude-plugin and replayed by auto-update.
…-adds a missing marketplace Review fixes for the Claude Code plugin update: - 'claude plugin update plannotator@plannotator --scope user' in all three installers and every printed manual command: current Claude Code auto-detects the scope and, inside a project with a project-scope install, updated that record and left the user install old. - install.sh keeps claude's output and the timeout marker in one private mktemp -d directory, removed afterwards; no directory, no update. - A missing plannotator marketplace prints 'claude plugin marketplace add backnotprop/plannotator' instead. - A --version pin skips the update (one line). Auto-update's --version is the newest release it just resolved, exported as PLANNOTATOR_UPDATE_VERSION, so it is not a pin; no extra network call.
…en pipe' Start-Process -RedirectStandardInput copies its file into the child's stdin after the start and throws 'Broken pipe' when claude has already exited (seen on CI under Linux pwsh for every plugin test; a fast 'already up to date' can do the same for real users). install.ps1 and install.cmd's PowerShell now start claude with System.Diagnostics.Process, close its stdin pipe at once in its own try/catch, read stdout/stderr asynchronously, and report 'could not run claude' only when the start itself fails. New test: a claude that exits at once without reading stdin, five times per runner.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Claude Code plugin (
plannotator@plannotator) comes from a GitHub marketplace, which Claude Code does not auto-update by default. The installers only printedclaude plugin marketplace update plannotator/claude plugin update plannotator@plannotator, so updating the binary (by hand or through background auto-update, which reruns install.sh) left users on an old plugin, without the mod's Inbox connection and every mod fix since.What
All three installers (
install.sh,install.ps1,install.cmd, kept in step) now, right after the legacy marketplace-clonehooks.jsonrepair:${CLAUDE_CONFIG_DIR:-~/.claude}/plugins/installed_plugins.json(user-scope record; a v1 record withoutscopecounts; project/local-only installs are left alone). Noclaude plugin listparsing.claudeCLI is on PATH and the user did not opt out, runclaude plugin marketplace update plannotatorthenclaude plugin update plannotator@plannotator, each with stdin closed,CLAUDECODEcleared, and a 120 s time limit (pure-shell watchdog on POSIX,WaitForExit+ kill on Windows).version/gitCommitSha/installPath:Claude Code plugin: updated to 0.28.11 (restart Claude Code to load it).Claude Code plugin: already up to date (0.28.11).Claude Code plugin: could not update it (<reason>). Run these, then restart Claude Code:+ the two commands. The install still exits 0.Claude Code plugin: not updated (--skip-claude-plugin).It never installs the plugin, never touches other marketplaces/plugins, and never starts a Claude session.
Opt-out:
--skip-claude-plugin(PowerShell-SkipClaudePlugin),PLANNOTATOR_SKIP_CLAUDE_PLUGIN_UPDATE=1,{ "skipInstall": { "claudePlugin": true } }; flag > env > config.--minimalskips it;--non-interactivedoes not. The flag is recorded ininstall-flags.jsonasskip-claude-pluginand added to the auto-update allowlist (packages/server/auto-update.ts). Older binaries drop the unknown id with anupdate.logline (parseInstallFlags).Docs: CLAUDE.md env row + auto-update flag list, marketing installation + environment-variables pages, README update line.
Tests
scripts/install.test.tswith a fakeclaudethat logs its argv (temp HOME, tempCLAUDE_CONFIG_DIR, no real CLI):--minimal, failing marketplace update, failing plugin update, hanging claude (1 s limit), no claude on PATH, install-flags.json.auto-update.test.ts:skip-claude-pluginkept and spelled per installer.bun test scripts/install.test.ts packages/server/auto-update.test.ts(with pwsh 7.5 on PATH): 255 pass, 0 fail.bun run typecheckclean. shellcheck: no new warnings.Unsure
claude plugin updatedefaults to the user scope (that is why only user-scope records trigger it); not verified against a live Claude Code.CLAUDECODEis cleared defensively in case plugin subcommands refuse to run nested; not verified live.plugin updatecopies from the local marketplace clone (the docs in this repo already say refreshing the marketplace alone is not enough, and the reverse is presumed).